const Router = require('koa-router')
const collectionService = require('../services/collection')
const router = new Router({prefix:'/api/collection'})

// const middle = () => {
//     // ctx.set('Accept','application/json')
//     console.log('col')
// }


router.get('/view', async (ctx)=>{
    console.log('col,view')
    const list = await collectionService.viewCollection()
    // ctx.send({list:list,res:200})
    // console.log(list)
    ctx.body = {list:list,code:200}
    //  next()
})


module.exports = router